#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;
using LL = long long;

const int N = 2e5 + 10;

int n, x;
int q[N];

void solve(){
    scanf("%d%d", &n, &x);

    for(int i = 0; i < n; i ++){
        scanf("%d", &q[i]);
    }

    LL left = q[0] - x;
    LL right = q[0] + x;

    int cnt = 0;
    for(int i = 0; i < n; i ++){
        LL tl = (LL)q[i] - x;
        LL tr = (LL)q[i] + x;

        if(tr < left){
            cnt ++;
            left = tl;
            right = tr;
        }else if(right < tl){
            cnt ++;
            left = tl;
            right = tr;
        }else{
            left = max(left, tl);
            right = min(right, tr);
        }
    }

    printf("%d\n", cnt);
}

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);

    int T;
    scanf("%d", &T);
    while(T--){
        solve();
    }
    return 0;
}